// 轮播图页面的 js 文件
const app = getApp();
const wuhuUrl = app.globalData.wuhuUrl;
Page({
  data: {
    zhifuShow: false,
    ContentShow:false,
    leftshow:false,
    rightshow:false,
    active: 1,
    agree: false, // 默认复选框未选中
    indicatorDots: true, // 是否显示面板指示点
    autoplay: true, // 是否自动切换
    interval: 5000, // 自动切换时间间隔
    duration: 1000, // 滑动动画时长
    circular: true, // 是否采用衔接滑动
    indicatorColor: 'rgba(255, 255, 255, 0.8)', // 指示点颜色
    indicatorActiveColor: 'red', // 当前选中的指示点颜色
    imageUrls: [ // 轮播图片链接数组
      'https://kangkangkangkang.oss-cn-wuhan-lr.aliyuncs.com/%E5%BA%B7/vip/vip2.png',
      'https://kangkangkangkang.oss-cn-wuhan-lr.aliyuncs.com/%E5%BA%B7/vip/vip3.png',
      'https://kangkangkangkang.oss-cn-wuhan-lr.aliyuncs.com/%E5%BA%B7/vip/vip4.png'
    ],
    vipPackages: [
      { name: '功能1', description: 'Pdf转换', record: 'PDF' },
      { name: '功能2', description: '图片压缩', record: 'Picture' },
      { name: '功能3', description: '文字提取', record: 'Word' },
      { name: '功能4', description: '表格提取', record: 'Excel' },
      { name: '功能5', description: '书记扫描', record: 'Book' },
      // 其他套餐...
    ]
  },
  handleCardTap: function(event) {
    const index = event.currentTarget.dataset.index;
    let vipPackages = this.data.vipPackages;

    // 遍历所有卡片，将除了被点击的卡片外的其他卡片样式恢复
    vipPackages.forEach((item, i) => {
      if (i !== index) {
        item.selected = false;
      }
    });

    // 根据点击的卡片索引，切换其选中状态
    vipPackages[index].selected = !vipPackages[index].selected;

    // 更新数据
    this.setData({
      vipPackages: vipPackages
    });
  },
   // 复选框改变事件处理函数
   handleCheckboxChange: function(event) {
    this.setData({
      agree: event.detail.value
    });
  },
  // 支付二维码弹窗
  ZhiFuShowPopup() {
    this.setData({ zhifuShow: true });
  },

  ZhiFuOnClose() {
    this.setData({ zhifuShow: false });
  },
  // 更多特权弹窗
  ContentShowPopup() {
    this.setData({ ContentShow: true });
  },

  ContentOnClose() {
    this.setData({ ContentShow: false });
  },
  onChange(event) {
  console.log(event)
    wx.showToast({
      title: `切换到 ${event.detail.title}`,
      icon: 'none',
    });
  },
  FuWuhHandleTermsTap() {
    this.setData({ leftshow: true });
  },

  LEFTonClose() {
    this.setData({ leftshow: false });
  },
  YinSiHandleTermsTap() {
    this.setData({ righttshow: true });
  },

  RIGHTonClose() {
    this.setData({ righttshow: false });
  },
});
